
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>
   <TITLE>eul2m_c</TITLE>
</HEAD>

<BODY style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<A name="TOP"></A>

<table style="text-align: left; margin-left: auto; margin-right: auto; width: 800px;"
 border="0" cellpadding="5" cellspacing="2">
  <tbody>
    <tr>
      <td style="background-color: rgb(153, 153, 153); vertical-align: middle; text-align: center;">
      <div align="right"> 
      <small><small><a href="index.html">Index Page</a></small></small>
      </div>
      <b>eul2m_c</b> </td>
    </tr>

    <tr>
      <td style="vertical-align: top;">

<small><div align="center">
<A HREF="index.html#A">A</A>&nbsp;
<A HREF="index.html#B">B</A>&nbsp;
<A HREF="index.html#C">C</A>&nbsp;
<A HREF="index.html#D">D</A>&nbsp;
<A HREF="index.html#E">E</A>&nbsp;
<A HREF="index.html#F">F</A>&nbsp;
<A HREF="index.html#G">G</A>&nbsp;
<A HREF="index.html#H">H</A>&nbsp;
<A HREF="index.html#I">I</A>&nbsp;
<A HREF="index.html#J">J</A>&nbsp;
<A HREF="index.html#K">K</A>&nbsp;
<A HREF="index.html#L">L</A>&nbsp;
<A HREF="index.html#M">M</A>&nbsp;
<A HREF="index.html#N">N</A>&nbsp;
<A HREF="index.html#O">O</A>&nbsp;
<A HREF="index.html#P">P</A>&nbsp;
<A HREF="index.html#Q">Q</A>&nbsp;
<A HREF="index.html#R">R</A>&nbsp;
<A HREF="index.html#S">S</A>&nbsp;
<A HREF="index.html#T">T</A>&nbsp;
<A HREF="index.html#U">U</A>&nbsp;
<A HREF="index.html#V">V</A>&nbsp;
<A HREF="index.html#W">W</A>&nbsp;
<A HREF="index.html#X">X</A>&nbsp;
</div></small>
       <br>
       <table style="text-align: left; width: 60%; margin-left: auto; margin-right: auto;"
       border="0" cellspacing="2" cellpadding="2">
        <tbody>
          <tr>
            <td style="width: 50%; text-align: center;">
            <small>
              <a href="#Procedure">Procedure<br></a>
              <a href="#Abstract">Abstract<br></a>
              <a href="#Required_Reading">Required_Reading<br></a>
              <a href="#Keywords">Keywords<br></a>
              <a href="#Brief_I/O">Brief_I/O<br></a>
              <a href="#Detailed_Input">Detailed_Input<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Detailed_Output">Detailed_Output<br></a>
              <a href="#Parameters">Parameters<br></a>
              <a href="#Exceptions">Exceptions<br></a>
              <a href="#Files">Files<br></a>
              <a href="#Particulars">Particulars<br></a>
              <a href="#Examples">Examples<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Restrictions">Restrictions<br></a>
              <a href="#Literature_References">Literature_References<br></a>
              <a href="#Author_and_Institution">Author_and_Institution<br></a>
              <a href="#Version">Version<br></a>
              <a href="#Index_Entries">Index_Entries<br></a>
             </small>
            </td>
          </tr>
        </tbody>
</table>

<h4><a name="Procedure">Procedure</a></h4>
<PRE>
   void eul2m_c ( SpiceDouble  angle3,
                  SpiceDouble  angle2,
                  SpiceDouble  angle1,
                  SpiceInt     axis3,
                  SpiceInt     axis2,
                  SpiceInt     axis1,
                  SpiceDouble  r [3][3] )

</PRE>
<h4><a name="Abstract">Abstract</a></h4>
<PRE>
   Construct a rotation matrix from a set of Euler angles.
</PRE>
<h4><a name="Required_Reading">Required_Reading</a></h4>
<PRE>
   <a href="../req/rotation.html">ROTATION</a>
</PRE>
<h4><a name="Keywords">Keywords</a></h4>
<PRE>
   MATRIX
   ROTATION
   TRANSFORMATION


</PRE>
<h4><a name="Brief_I/O">Brief_I/O</a></h4>
<PRE>
   Variable  I/O  Description
   --------  ---  --------------------------------------------------
   angle3,
   angle2,
   angle1     I   Rotation angles about third, second, and first
                  rotation axes (radians).
   axis3,
   axis2,
   axis1      I   Axis numbers of third, second, and first rotation
                  axes.

   r          O   Product of the 3 rotations.
</PRE>
<h4><a name="Detailed_Input">Detailed_Input</a></h4>
<PRE>
   angle3,
   angle2,
   angle1,

   axis3,
   axis2,
   axis1          are, respectively, a set of three angles and three
                  coordinate axis numbers; each pair angleX and
                  axisX specifies a coordinate transformation
                  consisting of a rotation by angleX radians about
                  the coordinate axis indexed by axisX.  These
                  coordinate transformations are typically
                  symbolized by

                     [ angleX ]     .
                               axisX

                  See the -Particulars section below for details
                  concerning this notation.

                  Note that these coordinate transformations rotate
                  vectors by

                     -angleX

                  radians about the axis indexed by axisX.

                  The values of axisX may be 1, 2, or 3, indicating
                  the x, y, and z axes respectively.
</PRE>
<h4><a name="Detailed_Output">Detailed_Output</a></h4>
<PRE>
   r              is a rotation matrix representing the composition
                  of the rotations defined by the input angle-axis
                  pairs.  Together, the three pairs specify a
                  composite transformation that is the result of
                  performing the rotations about the axes indexed
                  by axis1, axis2, and axis3, in that order.  So,

                     r = [ angle3 ]     [ angle2 ]      [ angle1 ]
                                  axis3          axis2           axis1

                  See the -Particulars section below for details
                  concerning this notation.

                  The resulting matrix r may be thought of as a
                  coordinate transformation; applying it to a vector
                  yields the vector's coordinates in the rotated
                  system.

                  Viewing r as a coordinate transformation matrix,
                  the basis that r transforms vectors to is created
                  by rotating the original coordinate axes first by
                  angle1 radians about the coordinate axis indexed
                  by axis1, next by angle2 radians about the
                  coordinate axis indexed by axis2, and finally by
                  angle3 radians about coordinate axis indexed by
                  axis3.  At the second and third steps of this
                  process, the coordinate axes about which rotations
                  are performed belong to the bases resulting from
                  the previous rotations.
</PRE>
<h4><a name="Parameters">Parameters</a></h4>
<PRE>
   None.
</PRE>
<h4><a name="Exceptions">Exceptions</a></h4>
<PRE>
   1)   If any of axis3, axis2, or axis1 do not have values in

           { 1, 2, 3 },

        the error SPICE(BADAXISNUMBERS) is signalled.
</PRE>
<h4><a name="Files">Files</a></h4>
<PRE>
   None.
</PRE>
<h4><a name="Particulars">Particulars</a></h4>
<PRE>
 section below for details
                  concerning this notation.

                  Note that these coordinate transformations rotate
                  vectors by

                     -angleX

                  radians about the axis indexed by axisX.

                  The values of axisX may be 1, 2, or 3, indicating
                  the x, y, and z axes respectively.
</PRE>
<h4><a name="Examples">Examples</a></h4>
<PRE>
   1)  Create a coordinate transformation matrix by rotating
       the original coordinate axes first by 30 degrees about
       the z axis, next by 60 degrees about the y axis resulting
       from the first rotation, and finally by -50 degrees about
       the z axis resulting from the first two rotations.

                /.

                Create the coordinate transformation matrix

                              o          o          o
                   R  =  [ -50  ]   [  60  ]   [  30  ]
                                 3          2          3

                All angles in radians, please.   The CSPICE
                function <a href="rpd_c.html">rpd_c</a> (radians per degree) gives the
                conversion factor.

                The z axis is `axis 3'; the y axis is `axis 2'.
                ./

                angle1 = <a href="rpd_c.html">rpd_c</a>() *  30.;
                angle2 = <a href="rpd_c.html">rpd_c</a>() *  60.;
                angle3 = <a href="rpd_c.html">rpd_c</a>() * -50.;

                axis1  = 3;
                axis2  = 2;
                axis3  = 3;

                <b>eul2m_c</b> (  angle3, angle2, angle1,
                           axis3,  axis2,  axis1,   r  );


   2)  A trivial example using actual numbers.

       The call

          <b>eul2m_c</b> (  0.,     0.,     <a href="halfpi_c.html">halfpi_c</a>(),
                     1,        1,            3,      r  );

       sets r equal to the matrix

          +-                  -+
          |  0      1       0  |
          |                    |
          | -1      0       0  |.
          |                    |
          |  0      0       1  |
          +-                  -+


   3)  Finding the rotation matrix specified by a set of `clock,
       cone, and twist' angles, as defined on the Voyager 2 project:

          Voyager 2 narrow angle camera pointing, relative to the
          Sun-Canopus coordinate system, was frequently specified
          by a set of Euler angles called `clock, cone, and twist'.
          These defined a 3-2-3 coordinate transformation matrix
          TSCTV as the product

             [ twist ]  [ cone ]   [ clock ] .
                      3         2           3

          Given the angles clock, cone, and twist (in units of
          radians), we can compute tsctv with the call

             <b>eul2m_c</b> (  twist,  cone,  clock,
                        3,      2,     3,      tsctv  );


   4)  Finding the rotation matrix specified by a set of `right
       ascension, declination, and twist' angles, as defined on the
       Galileo project:

          Galileo scan platform pointing, relative to an inertial
          reference frame, (EME50 variety) is frequently specified
          by a set of Euler angles called `right ascension (RA),
          declination (Dec), and twist'. These define a 3-2-3
          coordinate transformation matrix TISP as the product

             [ Twist ]  [ pi/2 - Dec ]   [ RA ] .
                      3               2        3

          Given the angles ra, dec, and twist (in units of radians),
          we can compute tisp with the code fragment

             <b>eul2m_c</b> (  twist,   <a href="halfpi_c.html">halfpi_c</a>()-dec,   ra,
                        3,       2,                3,   tisp  );
</PRE>
<h4><a name="Restrictions">Restrictions</a></h4>
<PRE>
   Beware:  more than one definition of &quot;RA, DEC and twist&quot; exists.
</PRE>
<h4><a name="Literature_References">Literature_References</a></h4>
<PRE>
   [1]  `Galileo Attitude and Camera Models', JPL IOM 314-323,
         W. M. Owen, Jr.,  Nov. 11, 1983.  NAIF document number
         204.0.
</PRE>
<h4><a name="Author_and_Institution">Author_and_Institution</a></h4>
<PRE>
   N.J. Bachman   (JPL)
</PRE>
<h4><a name="Version">Version</a></h4>
<PRE>
   -CSPICE Version 1.0.2, 26-DEC-2006 (NJB)

      Fixed header typo.

   -CSPICE Version 1.0.1, 13-OCT-2004 (NJB)

      Fixed header typo.

   -CSPICE Version 1.0.0 08-FEB-1998 (NJB)

      Based on SPICELIB Version 1.1.1, 10-MAR-1992 (WLT)
</PRE>
<h4><a name="Index_Entries">Index_Entries</a></h4>
<PRE>
   euler angles to matrix
</PRE>
<h4>Link to routine eul2m_c source file <a href='../../../src/cspice/eul2m_c.c'>eul2m_c.c</a> </h4>

      </td>
    </tr>
  </tbody>
</table>

   <pre>Wed Jun  9 13:05:23 2010</pre>

</body>
</html>

